VERSION 5.00
Begin VB.Form frmBan 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   2760
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5745
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2760
   ScaleWidth      =   5745
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdUnban 
      Default         =   -1  'True
      Height          =   375
      Left            =   4440
      TabIndex        =   3
      Top             =   2280
      Width           =   1215
   End
   Begin VB.CommandButton cmdClose 
      Cancel          =   -1  'True
      Height          =   375
      Left            =   3120
      TabIndex        =   2
      Top             =   2280
      Width           =   1215
   End
   Begin VB.ListBox lstBan 
      Height          =   1815
      Left            =   120
      TabIndex        =   1
      Top             =   360
      Width           =   5535
   End
   Begin VB.Label Label1 
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3615
   End
End
Attribute VB_Name = "frmBan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim WithEvents IRCLink As clsModIRC
Attribute IRCLink.VB_VarHelpID = -1

Private Sub cmdClose_Click()
Unload Me
End Sub

Private Sub cmdunban_Click()
frmMain.AddToHistory "Unbanning " + GetWord(lstBan.List(lstBan.ListIndex), 1), True
frmMain.IRCInterface.RawSend "MODE " + GetWord(Me.Caption, 4) + " -b " + _
  GetWord(lstBan.List(lstBan.ListIndex), 1)
lstBan.RemoveItem lstBan.ListIndex
End Sub

Private Sub SetupBanList(UserList, ByVal Chan As String)
Dim c As Long
Dim ChannelListString As String

Me.Caption = SPrintF(lang.Messages(6), Chan)
lstBan.Clear

If UBound(UserList) = 0 Then
  lstBan.AddItem lang.Messages(7)
  Exit Sub
End If

For c = 1 To UBound(UserList)

  ChannelListString = GetWord(UserList(c), 1) + _
    " (set by " + GetWord(UserList(c), 2) + ")"
  lstBan.AddItem ChannelListString

Next

cmdUnban.Enabled = True

End Sub

Private Sub Form_Load()
cmdClose.Caption = lang.Buttons(4)
cmdUnban.Caption = lang.Buttons(5)
Label1.Caption = lang.Messages(5)


Set IRCLink = frmMain.IRCInterface
IRCLink.RawSend "MODE " + modAC.currentChannel + " +b"
Me.Caption = "Ban List"
lstBan.Clear
lstBan.AddItem "Populating list..."
cmdUnban.Enabled = False
' check for oper
If IsChanop = False Then cmdUnban.Enabled = False

End Sub

Private Sub IRCLink_BanList(BanList() As String, Channel As String)
SetupBanList BanList, Channel
End Sub

